class Animal {

  public readonly type: string
  protected feature: string
  private name: string

  constructor(type: string, feature: string) {
    this.type = type
    this.feature = feature
  }

  static isMammal: boolean = true
}

class Dog extends Animal {

  constructor() {
    super('dog', 'four legs') // 调用父类构造函数，要传相应的参数
  }

  bark() {
    console.log('wong wong')
  }

  getFeature() {
    console.log(this.feature)
  }
}

const dog = new Dog()

console.log(dog.type)
dog.getFeature() // protected变量只能在子类中访问，子类的实例不能访问
console.log(Dog.isMammal)
dog.bark()